var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
    // console.log(req);
    console.log(req.headers.cookies + ' index的cookie');
    if (!(req.headers.cookie && /username/.test(req.headers.cookie))) {
        res.redirect('./login');
    } else {
        res.render('index')
    }
});

module.exports = router;
